import 'dart:convert';

import 'package:enterprise_v6_app/app/data/entities/closure/gate_equipment_entity.dart';
import 'package:enterprise_v6_app/generated/json/base/json_field.dart';
import 'package:enterprise_v6_app/generated/json/closure_appointment_entity.g.dart';
export 'package:enterprise_v6_app/generated/json/closure_appointment_entity.g.dart';

/// 封闭化预约表实体类
@JsonSerializable()
class ClosureAppointmentEntity {
  ClosureAppointmentEntity();

  factory ClosureAppointmentEntity.fromJson(Map<String, dynamic> json) => $ClosureAppointmentEntityFromJson(json);

  ///	所属单位
  late String affiliatedUnit = '';

  ///	审核状态 0：待审核 1：通过 2：不通过
  late int appointmentStatus = 0;

  ///	车辆状态 1:重载,2:空载
  late String carStatus = '';

  ///	车辆类型 数据来源字典表
  late String carType = '';

  ///	车辆类型
  late String carTypeValue = '';

  ///	公司
  late String company = '';

  ///	企业唯一编码
  late String companyCode = '';

  ///	对接人
  late String contactPerson = '';

  ///	对接人id
  late String contactPersonId = '';

  ///	创建人姓名
  late String createBy = '';

  ///	创建人id
  late String createById = '';

  ///	创建时间
  late String createDate = '';

  ///	0:正常 1:已删除
  late String deleted = '';

  ///	目的地
  late String destination = '';

  ///	分区授权
  late String empower = '';

  ///	预约结束时间
  late String endDate = '';

  ///	1 通行 2 过期
  late int expire = 0;

  ///	闸机列表
  late List<GateEquipmentEntity> gateEquipmentList = [];

  ///	闸机列表名称
  late String gateEquipmentNames = '';

  ///	主键id
  late String id = '';

  ///	身份证ID
  late String idCard = '';

  ///	证件号码
  late String idNo = '';

  ///	进入的门禁编号
  late String inGateNo = '';

  ///	车牌号
  late String licensePlate = '';

  ///	姓名
  late String name = '';

  ///	押运员姓名
  late String nameOfEscort = '';

  ///	出的门禁编号
  late String outGateNo = '';

  ///	权限类型 0：临时 1：长期
  late int permissionType = 0;

  ///	对接人电话
  late String personToPersonPhoneNumber = '';

  ///	人员类型 数据来源字典表
  late String personType = '';

  ///	人员类型值
  late String personTypeValue = '';

  /// 人员类型 TYPE: 100.后台管理账号 1.企业人员账号 2.园区账号 3.政府人员账号 4:临时访客 5:第三方单位人员 6:其他
  late String type = '';

  ///	照片地址
  late String photoUrl = '';

  ///	到访理由
  late String reasonForVisit = '';

  ///	驳回原因
  late String rejectInfo = '';

  ///	预约类型 0：人员 1：普通车辆 2：危化车辆
  late int reservationType = 0;

  ///	审核人id
  late String reviewedBy = '';

  ///	审核时间
  late String reviewedDate = '';

  ///	审核人姓名
  late String reviewedName = '';

  ///	审核备注
  late String reviewedRemark = '';

  ///	专业
  late String speciality = '';

  ///	预约开始时间
  late String startDate = '';

  ///	职位名称
  late String title = '';

  ///	同行状态 0：已通行 1：未同行 2：已过期
  late int trafficStatus = 0;

  ///	运输介质
  late String transportMedium = '';

  ///	修改人姓名
  late String updateBy = '';

  ///	修改人id
  late String updateById = '';

  ///	修改时间
  late String updateDate = '';

  ///	联系电话
  late String visitorTelephone = '';

  ///	候检状态 1:候检重 2:已准入 3:拒绝
  late int waitingForInspectionStatus = 0;

  /// 性别: 0.男 1.女 2.保密
  late int sex = 2;

  /// 危化车辆候检相关
  /// 车辆外观状态 0:完好 1:破损 2:其他
  late int vehicleAppearanceStatus = 0;

  /// 车辆外观照片
  late List<String> vehicleAppearance = [];

  /// 驾驶证状态 0:有效中 1:缺失 2:到期
  late int driverLicenseStatus = 0;

  /// 驾驶证照片
  late List<String> driverLicense = [];

  ///	行驶证状态 0:有效中 1:缺失 2:到期
  late int drivingLicenseStatus = 0;

  ///	行驶证照片
  late List<String> drivingLicense = [];

  ///	货物状态 0:完好 1:破损 2:其他
  late int goodsStatus = 0;

  ///	货物照片
  late List<String> goods = [];

  ///	货物数量(/t)
  late int quantityOfGoods = 0;

  /// 候检描述
  late String waitingDescription = '';

  /// 检查人姓名
  late String inspectedBy = '';

  /// 检查人id
  late String inspectedById = '';

  /// 检查时间
  late String inspectedTime = '';

  Map<String, dynamic> toJson() => $ClosureAppointmentEntityToJson(this);

  @override
  String toString() {
    return jsonEncode(this);
  }
}
